<?php
error_reporting(E_ALL ^ E_NOTICE);
define('CMSAdmin','1');
$cmsaction=$_POST['cmsaction'];
if(empty($cmsaction))
{$cmsaction=$_GET['cmsaction'];}
if($cmsaction=='login')
{
	define('CMSAPage','login');
}
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
$link=db_connect();
$cmsdb=new mysqlquery();
if($cmsaction=="login")
{}
else
{
	//验证用户
	$lur=is_login();
	$logininid=$lur['userid'];
	$loginin=$lur['username'];
	$loginrnd=$lur['rnd'];
	//$loginlevel=$lur['groupid'];
	//$loginadminstyleid=$lur['adminstyleid'];
}
require("./adminfun.php");
if($cmsaction=="login")//登陆
{
	$username=$_POST['username'];
	$password=$_POST['password'];
	$key=$_POST['key'];
	$loginin=$username;
	cmslogin($username,$password,$key,$_POST);
}
elseif($cmsaction=="exit")//退出系统
{
	loginout($logininid,$loginin,$loginrnd);
}
else
{
	printerror("ErrorUrl","history.go(-1)");
}
db_close();
$cmsdb=null;
?>